<template>
  <el-row class="step-btn-group">
    <el-col :span="6" v-for="(v, i) in ruleSteps" :key="i">
      <router-link class="step-btn" :to="v.path" :class="isActive(v) ? 'active' : ''">{{i+1}}. {{v.name}}</router-link>
    </el-col>
  </el-row>
</template>
<script>
export default {
  name: 'RuleSteps',
  props: {
    steps: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      ruleSteps: [{
        name: '网址采集规则',
        path: 'siterules',
        pathName: 'SiteRules'
      }, {
        name: '内容采集规则',
        path: 'contentcollect',
        pathName: 'ContentCollect'
      }, {
        name: '内容发布规则',
        path: '',
        pathName: ''
      }, {
        name: '其他设置',
        path: '',
        pathName: ''
      }]
    }
  },
  methods: {
    isActive (v) {
      return v.pathName === this.$route.name
    }
  }
}
</script>
<style lang="scss" scoped>
.step-btn-group {
  height: 50px;
}
.step-btn {
  display: block;
  width: 100%;
  height: 50px;
  line-height: 50px;
  margin: 0;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #dcdfe6;
  font-weight: 500;
  border-left: 0;
  color: #606266;
  -webkit-appearance: none;
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
  transition: all .3s cubic-bezier(.645,.045,.355,1);
  &:focus {
    outline: none;
  }
  &:hover {
    color: #409eff;
  }
  &.active {
    color: #fff;
    background-color: #409eff;
    border-color: #409eff;
    box-shadow: -1px 0 0 0 #409eff;
  }
}
</style>
